home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / odosrc / odometer.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-02  |  7.6 KB  |  234 lines

  1. VERSION 2.00
  2. Begin Form Resource 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   0  'None
  5.    ClientHeight    =   1020
  6.    ClientLeft      =   1200
  7.    ClientTop       =   3420
  8.    ClientWidth     =   9990
  9.    ClipControls    =   0   'False
  10.    ControlBox      =   0   'False
  11.    Height          =   1425
  12.    Icon            =   ODOMETER.FRX:0000
  13.    Left            =   1140
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form2"
  16.    MaxButton       =   0   'False
  17.    MinButton       =   0   'False
  18.    ScaleHeight     =   1020
  19.    ScaleWidth      =   9990
  20.    Top             =   3075
  21.    Width           =   10110
  22.    Begin Timer CaptionTimer 
  23.       Interval        =   5000
  24.       Left            =   1560
  25.       Top             =   660
  26.    End
  27.    Begin PictureClip PicClip1 
  28.       Cols            =   20
  29.       Location        =   "7200,3300,1440,180"
  30.       Picture         =   ODOMETER.FRX:0302
  31.       Rows            =   10
  32.    End
  33.    Begin SSPanel Panel3D1 
  34.       Alignment       =   1  'Left Justify - MIDDLE
  35.       BackColor       =   &H00C0C0C0&
  36.       BevelInner      =   1  'Inset
  37.       BevelWidth      =   2
  38.       Caption         =   "       Sys              GDI             User              Mem                    k   C:                      k  D:                      k"
  39.       Font3D          =   0  'None
  40.       ForeColor       =   &H00000000&
  41.       Height          =   555
  42.       Left            =   0
  43.       TabIndex        =   0
  44.       Top             =   0
  45.       Width           =   9990
  46.       Begin PictureBox Counter6 
  47.          Height          =   255
  48.          Left            =   7800
  49.          ScaleHeight     =   225
  50.          ScaleWidth      =   1245
  51.          TabIndex        =   3
  52.          Top             =   150
  53.          Width           =   1275
  54.       End
  55.       Begin PictureBox Picture2 
  56.          AutoSize        =   -1  'True
  57.          BackColor       =   &H00C0C0C0&
  58.          BorderStyle     =   0  'None
  59.          Height          =   240
  60.          Left            =   9510
  61.          ScaleHeight     =   240
  62.          ScaleWidth      =   255
  63.          TabIndex        =   2
  64.          Top             =   105
  65.          Width           =   255
  66.       End
  67.       Begin PictureBox Picture1 
  68.          AutoSize        =   -1  'True
  69.          BackColor       =   &H00C0C0C0&
  70.          BorderStyle     =   0  'None
  71.          Height          =   195
  72.          Left            =   90
  73.          ScaleHeight     =   195
  74.          ScaleWidth      =   255
  75.          TabIndex        =   1
  76.          Top             =   105
  77.          Width           =   255
  78.       End
  79.       Begin PictureBox Counter5 
  80.          Height          =   255
  81.          Left            =   6060
  82.          ScaleHeight     =   225
  83.          ScaleWidth      =   1245
  84.          TabIndex        =   4
  85.          Top             =   150
  86.          Width           =   1275
  87.       End
  88.       Begin PictureBox Counter4 
  89.          Height          =   255
  90.          Left            =   4470
  91.          ScaleHeight     =   225
  92.          ScaleWidth      =   1065
  93.          TabIndex        =   5
  94.          Top             =   150
  95.          Width           =   1095
  96.       End
  97.       Begin PictureBox Counter3 
  98.          Height          =   255
  99.          Left            =   3225
  100.          ScaleHeight     =   225
  101.          ScaleWidth      =   465
  102.          TabIndex        =   6
  103.          Top             =   150
  104.          Width           =   495
  105.       End
  106.       Begin PictureBox Counter2 
  107.          Height          =   255
  108.          Left            =   2040
  109.          ScaleHeight     =   225
  110.          ScaleWidth      =   465
  111.          TabIndex        =   7
  112.          Top             =   150
  113.          Width           =   495
  114.       End
  115.       Begin PictureBox Counter1 
  116.          Height          =   255
  117.          Left            =   870
  118.          ScaleHeight     =   225
  119.          ScaleWidth      =   465
  120.          TabIndex        =   8
  121.          Top             =   150
  122.          Width           =   495
  123.       End
  124.    End
  125.    Begin Timer Mem_Timer 
  126.       Interval        =   10
  127.       Left            =   5100
  128.       Top             =   840
  129.    End
  130. Sub CaptionTimer_Timer ()
  131.     'set info in icon caption
  132.     If Resource.WindowState = 1 Then
  133.       Resource.Caption = "Sys = " & (SysReSrc * 100) & "% " & Format$((GetFreeSpace(&H0) / 1024 / 1024), "##.0") & " meg"
  134.       Else
  135.            Resource.Caption = ""
  136.       End If
  137. End Sub
  138. Sub Form_DblClick ()
  139.     'close
  140. End Sub
  141. Sub Form_Load ()
  142.     left = (Screen.Width / 2 - Width / 2)
  143.     top = (Screen.Height - Screen.Height + 25)
  144.     Height = 555
  145.      
  146.      picture1.Picture = PicClip1.GraphicCell(0)
  147.      picture2.Picture = PicClip1.GraphicCell(9)
  148.      SetWindowPos Resource.hWnd, HWND_TOPMOST, 0, 0, 0, 0, &H40
  149.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  150.      Resource.Counter1.Value = SysReSrc
  151.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  152.      Resource.Counter2.Value = GdiReSrc
  153.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  154.      Resource.Counter3.Value = UserReSrc
  155.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  156.      
  157.      z% = 1  ' free space
  158.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  159.      x& = DiskInfo&(Y%, z%)
  160.      Resource.Counter5.Value = x& / 1024
  161.      z% = 1  ' free space
  162.      t% = 2 'total space
  163.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  164.      x& = DiskInfo&(Y%, z%)
  165.      If x& = -1 Then
  166.       CounterFlag = True
  167.       Panel3D1.Caption = "       Sys              GDI             User              Mem                    k   C:                      k  C:                      total"
  168.       Msg$ = "No Drive D: Detected."
  169.       MsgBox Msg$, 64, "OdoMeter v1.2"
  170.       w& = DiskInfo&(3, t%)
  171.       Resource.Counter6.Value = w& / 1024
  172.       Else
  173.            Resource.Counter6.Value = x& / 1024
  174.       End If
  175. End Sub
  176. Sub Label5_DblClick ()
  177.     End
  178. End Sub
  179. Sub Label6_DblClick ()
  180.     End
  181. End Sub
  182. Sub Label7_DblClick ()
  183.     End
  184. End Sub
  185. Sub Label8_DblClick ()
  186.     End
  187. End Sub
  188. Sub Mem_Timer_Timer ()
  189.      ' Get system resources
  190.      SysReSrc = GetFreeSystemResources(GFSR_SYSTEMRESOURCES) / 100
  191.      Resource.Counter1.Value = SysReSrc
  192.      GdiReSrc = GetFreeSystemResources(GFSR_GDIRESOURCES) / 100
  193.      Resource.Counter2.Value = GdiReSrc
  194.      UserReSrc = GetFreeSystemResources(GFSR_USERRESOURCES) / 100
  195.      Resource.Counter3.Value = UserReSrc
  196.      Resource.Counter4.Value = GetFreeSpace(&H0) / 1024
  197.      
  198.      z% = 1  ' free space
  199.      Y% = 3  ' drive 0 is default drive drive A is 1 etc.
  200.      
  201.      x& = DiskInfo&(Y%, z%)
  202.      Resource.Counter5.Value = x& / 1024
  203.      Y% = 4  ' drive 0 is default drive drive A is 1 etc.
  204.      t% = 2 'total space
  205.      If CounterFlag = True Then
  206.       w& = DiskInfo&(3, t%)
  207.       Resource.Counter6.Value = w& / 1024
  208.       ElseIf CounterFlag = False Then
  209.            x& = DiskInfo&(Y%, z%)
  210.            Resource.Counter6.Value = x& / 1024
  211.       End If
  212. End Sub
  213. Sub Picture1_Click ()
  214.      Unload Resource
  215. End Sub
  216. Sub Picture1_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  217.      picture1.Picture = PicClip1.GraphicCell(0 + 10)
  218. End Sub
  219. Sub Picture1_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  220.      
  221.      picture1.Picture = PicClip1.GraphicCell(0)
  222. End Sub
  223. Sub Picture2_Click ()
  224.      WindowState = 1
  225. End Sub
  226. Sub Picture2_MouseDown (Button As Integer, Shift As Integer, x As Single, Y As Single)
  227.      
  228.      picture2.Picture = PicClip1.GraphicCell(9 + 10)
  229. End Sub
  230. Sub Picture2_MouseUp (Button As Integer, Shift As Integer, x As Single, Y As Single)
  231.      
  232.      picture2.Picture = PicClip1.GraphicCell(9)
  233. End Sub
  234.